package com.fernfx.xingtan.my.model;

import com.fernfx.xingtan.Constant;
import com.fernfx.xingtan.common.network.IRequestCallback;
import com.fernfx.xingtan.common.network.SJJNetworkProxy;
import com.fernfx.xingtan.my.contract.RealVerifyContract;
import com.fernfx.xingtan.utils.FastJsonUtil;
import com.fernfx.xingtan.utils.OtherUtil;

import java.util.Map;

/**
 * Created by admin on 2018/8/15.
 */

public class RealVerifyModel implements RealVerifyContract.Model {
    @Override
    public void request(Map<String, Object> requestArgsMap, IRequestCallback iRequestCallback) {
        String url = OtherUtil.getGetUrl(Constant.RequestArgs.AUTHENTICATION_URL,requestArgsMap);
        SJJNetworkProxy.getInstance().get(url,null,iRequestCallback);
    }

    @Override
    public void saveAuthentication(Map<String, Object> requestArgsMap,IRequestCallback iRequestCallback) {
        String requestText = FastJsonUtil.BeanToJson(requestArgsMap);
        SJJNetworkProxy.getInstance().post(Constant.RequestArgs.SAVE_AUTHENTICATION_URL,null,requestText,iRequestCallback);
    }
}
